#include<stdio.h>
int main()
{
	int n;
	scanf("%d",&n);
	float prize=0;
	if(n>500000)
	{
		prize=200000*0.03+300000*0.025+(n-500000)*0.02;
	}
	else if(n>200000&&n<=500000)
	{
		prize=200000*0.03+(n-200000)*0.025;
	}
	else if(n<=200000)
	{
		prize=n*0.03;
	}
	printf("%.3f",prize);
	return 0;
}
